package com.coderg.gmall.item.controller;

import com.coderg.gmall.common.result.Result;
import com.coderg.gmall.item.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @Description 商品详情页面使用的控制层
 * @Author CoderG
 * @Date 2025/5/22 21:45
 **/
@RestController
@RequestMapping(value = "/item/info")
public class ItemController {
    @Autowired
    ItemService itemService;
    /**
     * 获取skuInfo
     * @param skuId
     * @return
     */
    @GetMapping(value = "/getSkuInfo/{skuId}")
    public Result getSkuInfo(@PathVariable("skuId") Long skuId){
        Map<String, Object> skuInfo = itemService.getSkuInfo(skuId);
        return Result.ok(skuInfo);
    }

}
